#No2.显示lena
import cv2 as cv
filename = r'E:/images/lena.jpg'
img = cv.imread(filename)
cv.imshow("Hello World!",img)




#No3 对Lena图像，分解得到RGB分量及HSV分量，显示各分量，并对结果进行比较说明
cv.imshow("R",img[:,:,2])
cv.imshow("G",img[:,:,1])
cv.imshow("B",img[:,:,0])


hsv= cv.cvtColor(img,cv.COLOR_BGR2HSV)
cv.imshow("H",hsv[:,:,0])
cv.imshow("S",hsv[:,:,1])
cv.imshow("V",hsv[:,:,2])
cv.waitKey()
cv.destroyAllWindows()